CopyFolder is a XCMD allowing to copy a whole folder, including all enclosed folders and files.
SYNTAX
CopyFolder <folder path, name or pathname>[,<dest path or name>]
[,<files>][,"ResolveAlias"][,"DontShowProgress"]
PARAMETERS
<folder path, name or pathname> can be a single name or whole pathname. If just a single name is supplied, the folder is assumed to be in the same folder than the current stack.
<dest path or name> is optional. If not supplied, the file will be copied in the same folder as "Copy of...". If a single name is passed, the copy of the folder will take that new name in the same folder. If the second param end with colon, the folder will be copied in the designed folder and will keep its original name. Finally, a whole pathname can be provided to define both dest. directory and new folder name.
<files> is a boolean, making the XCMD copy or not the included files. With false, only the folder structure will be copied. Default is true.
"ResolveAlias" will be used when you want any alias file contained in the folder to be resolved before copying. In this case, the pointed files will be copied rather than their alias. Default is non-resolving aliases.
"DontShowProgress" will allow to hide progress dialog.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
If the copy is successfull, the Result will be empty. If an error occurs, either the copy will be aborted (fatal error), or may continue (non-fatal error on a file). The Result will then return one line for each found error, each line containing two items : <error description>,<file pathname>.
ERRORS
Error description can be one of these :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Volume is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : MacOS param error"
"Error : AppleShare insufficient privileges"
"Error : No more disk space"
"Error : Missing parameter(s)"
"Error : Couln't create copy buffer"
"Error : Cannot copy to original folder"
HISTORY
2.5 05/01/94
• Fixed a random crash
2.4 04/22/94
• Copy now preserves access privileges
• Copy now preserves Finder comments
2.3 08/02/93
• Added test for infinite recursive copy
2.2 03/05/92
• Fixed drop-in destination folder bug
• CopyFolder is now able to copy currently opened files
• Removed copy interruption with mouse clicking
2.1 10/26/92
• Fixed empty folder bug
• Copy keeps files dates
• Enhanced Progress dialog
2.0 10/01/92
• Added Progress dialog
1.9 03/18/92
• Handling of non-fatal errors
• Added "ResolveAlias" param
• FinderLock attribute is preserved
1.8 03/13/92
• Fixed folder privileges bug
1.7 12/25/91
• Fixed alias file bug under System 7.0.1
• Copy now keeps owner and group of shared folders
1.6 11/22/91
• Fixed destination volume freespace calculation
1.5 10/29/91
• Modification/creation dates of files/folders are now preserved
1.4 08/04/91
• Added support for System 7.0 alias files
• General enhancement of the code
• Added "=" param for online help
• Added "=" param for online help
1.3
• Fixed "directory not found" bug with AppleShare server.
1.2
• AppleShare folder privileges are now preserved by the copy
Free for non-commercial use. Use in commercial software subjected to prior acknowledgement and licensing from the author, reachable at the following network addresses: